package cn.china.xfood.controller.main;


import cn.china.xfood.service.ProductService;
import entity.Product;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

@RestController
public class GetProductType {

    @Autowired
    ProductService productService;

    @RequestMapping("/getProductType")

    public List<String> selectByProductType(HttpServletResponse res){

        res.setHeader("Access-Control-Allow-Origin","*");
        List<String> productType = productService.getProductType();
        return productType;
    }

}
